home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d21
/
dvglue.arc
/
TVKGETC.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-01-09
|
1KB
|
39 lines
/*=======================================================*/
/* TVKGETC.C */
/* */
/* (c) Copyright 1988 Ralf Brown */
/* All Rights Reserved */
/* May be freely copied for noncommercial use, so long */
/* as this copyright notice remains intact, and any */
/* changes are marked in the comment blocks preceding */
/* functions. */
/*=======================================================*/
#include "tvapi.h"
/*=============================================*/
/* TVkbd_getc wait for next keystroke */
/* Ralf Brown 6/10/88 */
/*=============================================*/
int pascal TVkbd_getc(OBJECT kbd)
{
PARMLIST3 p ;
int retval ;
p.num_args = 0 ;
TVsendmsg(READ_MSG, kbd?TOS:ME, kbd, (PARMLIST *)&p) ;
retval = *((char far *)p.arg[1]) ;
if (p.arg[1] > 1) /* were there multiple keystrokes? */
{ /* yes, write back all but first */
p.num_args = 3 ;
p.arg[0]++ ; /* skip first byte of input */
p.arg[1]-- ;
p.arg[2] = (DWORD) TVkbd_status(kbd) ;
TVsendmsg(WRITE_MSG, kbd?TOS:ME, kbd, (PARMLIST *)&p) ;
}
return retval ;
}
/* End of TVKGETC.C */